package com.wk2un11.servlet;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wk2un11.dao.NewsDao;
import com.wk2un11.dao.NewsService;
import com.wk2un11.entity.News;


@WebServlet("/NewsServlet")
public class NewsServlet extends HttpServlet {

	protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		ArrayList<News> news=NewsService.getIndexNews();
			System.out.println(news);
		  req.setAttribute("news", news);
		  req.getRequestDispatcher("/article_list_more.jsp").forward(req, resp);
	}
}
